home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / pygtk / 2.0 / codegen / mergedefs.py < prev    next >
Text File  |  2006-01-20  |  679b  |  26 lines

  1. #!/usr/bin/env python
  2. # -*- Mode: Python; py-indent-offset: 4 -*-
  3.  
  4. import sys
  5. import defsparser
  6. from optparse import OptionParser
  7.  
  8. parser = OptionParser(usage="usage: %prog [options] generated-defs old-defs")
  9. parser.add_option("-p", "--merge-parameters",
  10.                   help="Merge changes in function/methods parameter lists",
  11.                   action="store_true", dest="parmerge", default=False)
  12. (options, args) = parser.parse_args()
  13.  
  14. if len(args) != 2:
  15.     parser.error("wrong number of arguments")
  16.  
  17. newp = defsparser.DefsParser(args[0])
  18. oldp = defsparser.DefsParser(args[1])
  19.  
  20. newp.startParsing()
  21. oldp.startParsing()
  22.  
  23. newp.merge(oldp, options.parmerge)
  24.  
  25. newp.write_defs()
  26.